#include <iostream>
#include <algorithm>
#include <cstring>
#include <vector>

using namespace std;
const int N = 1e4 + 10;

int n;
struct Segment{
    double x, y1, y2;
    int k;

    bool operator < (const Segment& W){
        return x < W.x;
    }
}seg[N * 2];

struct Node{
    int l, r;
    int cnt;
    double len;
}node[N * 8];

vector<double> ys;

int find(double x){
    return lower_bound(ys.begin(), ys.end(), x) - ys.begin();
}

void pushup(int u){
    if(node[u].cnt){
        node[u].len = ys[node[u].r + 1] - ys[node[u].l];
    }else if(node[u].l != node[u].r){
        node[u].len = node[u << 1].len + node[u << 1 | 1].len;
    }else{
        node[u].len = 0;
    }
}


void build(int u, int l, int r){
    node[u] = {l, r, 0, 0};
    if(l == r) return;

    int mid = (l + r) >> 1;
    build(u << 1, l, mid), build(u << 1 | 1, mid + 1, r);
}

void modify(int u, int l, int r, int k){
    if(node[u].l >= l && node[u].r <= r){
        node[u].cnt += k;
        pushup(u);
    }else{
        int mid = (node[u].l + node[u].r) >> 1;
        if(l <= mid) modify(u << 1, l, r, k);
        if(r > mid) modify(u << 1 | 1, l, r, k);
        pushup(u);
    }
}

int main(){
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);

    int T = 1;

    while(scanf("%d", &n), n){
        ys.clear();


        for(int i = 0, j = 0; i < n; i ++){
            double x1, y1, x2, y2;
            scanf("%lf%lf%lf%lf", &x1, &y1, &x2, &y2);

            seg[j ++] = {x1, y1, y2, 1};
            seg[j ++] = {x2, y1, y2, -1};
            ys.push_back(y1), ys.push_back(y2);
        }

        sort(ys.begin(), ys.end());
        ys.erase(unique(ys.begin(), ys.end()), ys.end());

        build(1, 0, ys.size() - 2);

        sort(seg, seg + n * 2);

        double res = 0;

        for(int i = 0; i < n * 2; i ++){
            if(i > 0) res += node[1].len * (seg[i].x - seg[i - 1].x);
            modify(1, find(seg[i].y1), find(seg[i].y2) - 1, seg[i].k);
        }

        printf("Test case #%d\n", T ++ );
        printf("Total explored area: %.2lf\n\n", res);
    }

    return 0;
}